//sku模块
import request from '@/utils/request';
//sku列表的接口
///admin/product/list/{page}/{limit}
export const reqSkuList = (page,limit)=>request({url:`/admin/product/list/${page}/${limit}`,method:'get'});

//上架
///admin/product/onSale/{skuId}
export const reqSale = (skuId)=>request({url:`/admin/product/onSale/${skuId}`,method:'get'});

//下架
///admin/product/cancelSale/{skuId}
export const reqCancel = (skuId)=>request({url:`/admin/product/cancelSale/${skuId}`,method:'get'});

//获取SKU详情的接口
///admin/product/getSkuById/{skuId}  get
export const reqSkuById = (skuId)=>request({url:`/admin/product/getSkuById/${skuId}`,method:'get'});

export const getPageList = (page,limit, activityName)=>request({url:`${process.env.VUE_APP_REAL_API}/admin/acl/activity/${page}/${limit}`,method:'get', params: activityName});


export const update = (data)=>request({url:`${process.env.VUE_APP_REAL_API}/admin/acl/activity/update`,method:'put', data});

export const add = (data)=>request({url:`${process.env.VUE_APP_REAL_API}/admin/acl/activity/save`,method:'post', data});

/*
删除某个用户
*/
export function removeById(id) {
  return request({
    url: `${process.env.VUE_APP_REAL_API}/admin/acl/activity/remove/${id}`,
    method: 'delete'
  })
}

/*
批量删除多个用户
ids的结构: ids是包含n个id的数组
*/
export function removeUsers(ids) {
  return request({
    url: `${process.env.VUE_APP_REAL_API}/admin/acl/activity/batchRemove`,
    method: 'delete',
    data: ids
  })
}
